#include <stdio.h>

#include "drv_softi2c_bq769x0.h"
#include "bms_energy.h"


#include "freertos.h"
#include "task.h"

// thread config
#define ENERGY_TASK_STACK_SIZE	128
#define ENERGY_TASK_PRIORITY	  3
#define ENERGY_TASK_PERIOD		  200

static TaskHandle_t EnergyTaskHandler = NULL;

static void BMS_EnergyTaskEntry(void *paramter);
BMS_EnergyDataTypedef BMS_EnergyData;


void BMS_EnergyInit(void)
{
	BaseType_t res = xTaskCreate(BMS_EnergyTaskEntry,
															 "energy",
	                             ENERGY_TASK_STACK_SIZE,
	                             NULL,
															 ENERGY_TASK_PRIORITY,
															 &EnergyTaskHandler);
	if(res != pdPASS)
	{
		printf("Create Energy Task Fail\r\n");
	}
}

void BMS_EnergyTaskEntry(void *paramter)
{
	while(1)
	{		
		vTaskDelay(pdMS_TO_TICKS(ENERGY_TASK_PERIOD));
	}
}


